unit FormObjects;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls,
  Forms, Menus, Dialogs, StdCtrls;

type
  TSubForm = class(TForm)
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    constructor Create(aOwner: TComponent); override;
    destructor Destroy; override;
  end;

  procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('SubForms', [TSubForm]);
end;

constructor TSubForm.Create(aOwner: TComponent);
begin
  inherited Create(aOwner);
  if (csDesigning in ComponentState) then ReadComponentRes(Self.ClassName, Self);
end;

destructor TSubForm.Destroy;
begin
  SetDesigning(FALSE);
  inherited Destroy;
end;

procedure TSubForm.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.Style := WS_CHILD or WS_DLGFRAME or WS_VISIBLE or DS_CONTROL;
end;

end.

